home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Viewers / MultiView / Install MultiView < prev    next >
Text File  |  1998-06-24  |  12KB  |  495 lines

  1. ;
  2. ; $VER: Install MultiView 3.1 (09.11.97)
  3. ;
  4. ; Installer script for MultiView.
  5. ;
  6.  
  7. (set #english-lang 1)
  8. (set #polish-lang  2)
  9.  
  10.  
  11. ; Get current language (no need for lots of silly icons! ;). However, this
  12. ; won't properly work for all versions of the Installer. Some don't
  13. ; understand the language "default" in the tool types... :/
  14.  
  15. (if (= (exists "Env:Language") 1)
  16.     ; GetEnv reports "String too long" if the variable doesn't exist! :/
  17.     ; Dunno if this is fixed in V43... But we need to check anyway.
  18.     (set @language (getenv "language"))
  19. )
  20.  
  21.  
  22. ;**************************************************************************
  23. ;
  24. ; English strings
  25. ;
  26.  
  27. (set #default-lang #english-lang)
  28.  
  29. (set #builtin-lang "(built in)")
  30.  
  31. (set #bad-kick
  32.     "You must have AmigaOS Release 2.04 or higher to use MultiView."
  33. )
  34.  
  35. (set #install-parts "Please select the parts you wish to install")
  36.  
  37. (set #item-program "MultiView")
  38.  
  39. (set #item-library "FileID.library")
  40.  
  41. (set #item-guide   "MultiView.guide")
  42.  
  43. (set #item-locale  "Translations")
  44.  
  45. (set #parts-header-help
  46.     (cat
  47.         "    Here you select the different parts of MultiView that you would like to "
  48.         "install. After that, you select the details of the installation (such as "
  49.         "where the different files should be installed). You may choose to install "
  50.         "the following items:\n"
  51.     )
  52. )
  53.  
  54. (set #item-program-help
  55.     (cat
  56.         "    MultiView: This program is a replacement for C= MultiView and should be "
  57.                 "installed in SYS:Utilities/ directory.\n"
  58.     )
  59. )
  60.  
  61. (set #item-library-help
  62.     (cat
  63.         "    FileID.library: This library contains filetype recognizing functions.\n"
  64.     )
  65. )
  66.  
  67. (set #item-guide-help
  68.     (cat
  69.         "    MultiView.guide: The manual, in AmigaGuide format. It contains "
  70.         "some general information about MultiView.\n"
  71.     )
  72. )
  73.  
  74. (set #item-local-help
  75.     (cat
  76.         "    Translations: If you install a translation, then MultiView  "
  77.         "and FileID.library can operate in the language(s) you select.\n"
  78.     )
  79. )
  80.  
  81. (set #parts-footer-help
  82.     (cat
  83.         "    For more information about these items, please see the manual.\n"
  84.     )
  85. )
  86.  
  87. ; Only for expert users
  88. (set #where-program "Where would you like to install Main program?")
  89. (set #where-program-help
  90.     (cat
  91.                 "    MultiView: This program is a replacement for old Multiview written "
  92.                 "by Commodore programmers. You should install it in SYS:Utilities.\n"
  93.     )
  94. )
  95. (set #where-library "Where would you like to install FileID.library?")
  96.  
  97. (set #where-library-help
  98.     (cat
  99.         "    FileID.library is a shared library. As such, MultiView "
  100.         "(and applications using it) expects this file to be "
  101.         "avilable via the \"Libs:\"-assign, so please install this "
  102.         "file into the \"Libs:\" drawer, or make sure that the "
  103.         "drawer you install it in will be a part of your "
  104.         "\"Libs:\"-assign.\n"
  105.     )
  106. )
  107.  
  108. (set #where-guide "Where would you like to install MultiView.guide?")
  109.  
  110. (set #where-guide-help
  111.     (cat
  112.         "    MultiView.guide is a file in the standard AmigaGuide format. "
  113.         "As MultiView currently makes specific use of this file, you can install "
  114.         "it whereever you find convenient. If you have OS 3.0 or higher, "
  115.         "one such place is \"Help:\", as this is where other AmigaGuide "
  116.         "files often are installed.\n"
  117.     )
  118. )
  119.  
  120. ; Only for expert users, and an icon wasn't found
  121. (set #copy-guide-icon "Do you want to install the icon for MultiView.guide?")
  122.  
  123. (set #copy-guide-icon-help
  124.     (cat
  125.         "    Since you stated that you are an expert user, and there currently "
  126.         "is no icon for MultiView.guide where you selected to install it, "
  127.         "you get a chance to decide if the icon should be installed as well.\n"
  128.     )
  129. )
  130.  
  131. (set #which-language "Which languages should be installed?")
  132.  
  133. (set #which-language-help
  134.     (cat
  135.         "    The Amiga can be operated in many different languages. If you "
  136.         "want MultiView to use the same language as your Amiga Workbench, "
  137.         "then a couple of catalog files must be copied to your harddisk "
  138.         "for each language supported.\n"
  139.         "    To reduce the amount of space consumed by the language files, "
  140.         "you can select to have only the files of specific languages "
  141.         "copied.\n"
  142.         "    Simply check the boxes of the languages you wish to have have "
  143.         "available on your system.\n"
  144.     )
  145. )
  146.  
  147. (set #copy "Copying %s to %s...")
  148.  
  149. ;**************************************************************************
  150. ;
  151. ; Polish strings
  152. ;
  153.  
  154. (if (= @language "polski")
  155.     (
  156.         (set #default-lang #polski-lang)
  157.         (set #builtin-lang "(wbudowany)")
  158.         (set #bad-kick
  159.             "Musisz mieê system w wersji przynajmniej 2.04."
  160.         )
  161.  
  162.         (set #install-parts "Wybierz czëôci, które chcesz zainstalowaê")
  163.         (set #item-program "MultiView")
  164.         (set #item-library "FileID.library")
  165.         (set #item-guide   "MultiView.guide")
  166.         (set #item-locale  "Tîumaczenia")
  167.  
  168.         (set #parts-header-help
  169.             (cat
  170.                         "    Tu moûesz wybraê poszczególne czëôci pakietu do zainstalowania. Potem "
  171.                         "wybierzesz gdzie chcesz je zainstalowaê. Do wyboru masz :\n"
  172.             )
  173.         )
  174.  
  175.         (set #item-program-help
  176.             (cat
  177.                         "    MultiView: Ten program jest zamiennikiem dla starego MultiView-a napisanego "
  178.                         "jeszcze przez ludzi z Commodore. Powinieneô zainstalowaê go w katalogu SYS:Utilities.\n"
  179.             )
  180.         )
  181.  
  182.         (set #item-library-help
  183.             (cat
  184.                         "    FileID.library: Ta biblioteka zawiera funkcje do rozpoznawania plików.\n"
  185.             )
  186.         )
  187.  
  188.         (set #item-guide-help
  189.             (cat
  190.                         "    MultiView.guide: Dokumentacja w formacie AmigaGuide.\n"
  191.             )
  192.         )
  193.  
  194.         (set #item-local-help
  195.             (cat
  196.                         "    Tîumaczenia: Jeôli chcesz by MultiView i FileID.library mogîy "
  197.                         "byê z polskimi komunikatami musisz zainstalowaê odpowiednie katalogi.\n\n"
  198.             )
  199.         )
  200.  
  201.         (set #parts-footer-help
  202.             (cat
  203.                         "    Dodatkowe informacje znajdziesz w dokumentacji.\n"
  204.             )
  205.         )
  206.  
  207.         ; Only for expert users
  208.         (set #where-program "Gdzie chcesz zainstalowaê gîówny program?")
  209.         (set #where-program-help
  210.             (cat
  211.                         "    MultiView: Ten program jest zamiennikiem dla starego MultiView-a napisanego "
  212.                         "jeszcze przez ludzi z Commodore. Powinieneô zainstalowaê go w katalogu SYS:Utilities.\n"
  213.             )
  214.         )
  215.  
  216.         (set #where-library "Gdzie chcesz zainstalowaê FileID.library?")
  217.         (set #where-library-help
  218.             (cat
  219.             "    FileID.library jest zwykîâ bibliotekâ. MultiView "
  220.                     "i inne programy spodziewajâ sië, ûe znajdâ jâ w Libs:, tak wiëc "
  221.                     "musisz jâ zainstalowaê do katalogu bëdâcego czëôciâ twej kolekcji bibliotek.\n"
  222.             )
  223.         )
  224.  
  225.         (set #where-guide "Gdzie chcesz zainstalowaê MultiView.guide?")
  226.         (set #where-guide-help
  227.             (cat
  228.                 "    MultiView.guide jest plikiem w standardzie AmigaGuide. "
  229.                         "Proponowanym miejscem jest HELP:\n"
  230.             )
  231.         )
  232.  
  233.         (set #copy-guide-icon "Czy chcesz zainstalowaê ikonë dla MultiView.guide?")
  234.         (set #which-language "Które jëzyki powinny byê zainstalowane ?")
  235.         (set #copy "Kopiujë %s do %s...")
  236.     )
  237. )
  238.  
  239. ;**************************************************************************
  240. ;
  241. ; The actual installation script
  242. ;
  243. ; First some initializations
  244. ;
  245.  
  246. ; Check Kickstart version. Exit if not at least 2.04
  247. (if (< (/ (getversion) 65536) 37)
  248.         (abort #bad-kick)
  249. )
  250.  
  251. ; Since files are scatter installed, don't mention any specific location.
  252. (set @default-dest "")
  253.  
  254. ; Request proportinal fonts, if supported. This string is
  255. ; prepended to the first askoptions choice.
  256. (if (>= @installer-version 2752518)     ; 42 * 65536 + 6
  257.     ; At least version 42.6
  258.     (set #propfont "p")
  259.     ; Pre V42
  260.     (set #propfont "")
  261. )
  262.  
  263. (set #item-num-lib       1)
  264. (set #item-num-prog      2)
  265. (set #item-num-guide     4)
  266. (set #item-num-locale    8)
  267.  
  268. ; Find out default values for parts to install
  269. (set #install-default (BITOR #item-num-prog #item-num-lib #item-num-guide))
  270.  
  271. ; Locale installed?
  272. (if (AND (= 2 (exists "Locale:" (noreq))) (< 0 (getversion "locale.library" (resident))))
  273.     (set #install-default (BITOR #install-default #item-num-locale))
  274. )
  275.  
  276. ; Everything ready
  277.  
  278. (welcome)
  279.  
  280. ; Ask the user what to install
  281. (set #install-files
  282.     (askoptions
  283.         (prompt    #install-parts)
  284.         (help    #parts-header-help
  285.                         #item-program-help
  286.             #item-library-help
  287.             #item-guide-help
  288.             #item-local-help
  289.             #parts-footer-help "\n"
  290.             @askoptions-help)
  291.         (choices
  292.             (cat #propfont #item-program)
  293.                         #item-library
  294.             #item-guide
  295.             #item-locale
  296.         )
  297.         (default #install-default)
  298.     )
  299. )
  300.  
  301. ; Ask the user for the location of all parts
  302.  
  303. (set #program-dest  "SYS:Utilities")
  304.  
  305. ; Location for MultiView program (for experts)
  306. (if (AND (= @user-level 2) (BITAND #install-files #item-num-prog))
  307.     (set #program-dest
  308.         (askdir
  309.             (prompt  #where-program)
  310.             (help    #where-program-help "\n" @askdir-help)
  311.             (default #program-dest)
  312.         )
  313.     )
  314. )
  315.  
  316. (set #library-dest  "Libs:")
  317.  
  318. ; Location for FileID.library (for experts)
  319. (if (AND (= @user-level 2) (BITAND #install-files #item-num-lib))
  320.     (set #library-dest
  321.         (askdir
  322.             (prompt  #where-library)
  323.             (help    #where-library-help "\n" @askdir-help)
  324.             (default #library-dest)
  325.         )
  326.     )
  327. )
  328.  
  329. ; Location for MultiView.guide
  330. (if (BITAND #install-files #item-num-guide)
  331.     (
  332.         (set #guide-dest "Work:")
  333.  
  334.         (if (exists "Help:")
  335.             (set #guide-dest "Help:")
  336.         )
  337.  
  338.         (set #guide-dest
  339.             (askdir
  340.                 (prompt  #where-guide)
  341.                 (help    #where-guide-help "\n" @askdir-help)
  342.                 (default #guide-dest)
  343.             )
  344.         )
  345.  
  346.         (set #dest-guide-name (tackon #guide-dest "MultiView.guide.info"))
  347.  
  348.         (set #guide-icon
  349.             (if (AND (= @user-level 2 ) (= (exists #dest-guide-name) 0))
  350.                 (askbool
  351.                     (prompt #copy-guide-icon)
  352.                     (help    #copy-guide-icon-help " ")
  353.                 )
  354.                 0    ; Default is to not copy the icon
  355.             )
  356.         )
  357.     )
  358. )
  359.  
  360. ; .ct
  361. ; Which languages should be installed?
  362. (if (BITAND #install-files #item-num-locale)
  363.     (set #lang
  364.         (askoptions
  365.             (prompt    #which-language)
  366.             (help    #which-language-help "\n" @askoptions-help)
  367.             (choices
  368.                 (cat #propfont "Deutsch")
  369.                 (cat "English  " #builtin-lang)
  370.                 "Polski"
  371.             )
  372.             (default #default-lang)
  373.         )
  374.     )
  375. )
  376.  
  377. ; Everything set up. Now do the actual installation
  378.  
  379. (complete 10)
  380.  
  381. (if (BITAND #install-files #item-num-prog)
  382.     (
  383.         (copyfiles
  384.             (prompt    (#copy "MultiView" #program-dest))
  385.             (source    "MultiView")
  386.             (dest    #program-dest)
  387.         )
  388.         (copyfiles
  389.             (prompt    (#copy "MultiView" #program-dest))
  390.             (source    "MultiView.info")
  391.             (dest    #program-dest)
  392.         )
  393.     )
  394. )
  395.  
  396. (complete 30)
  397.  
  398. (if (BITAND #install-files #item-num-lib)
  399.     (
  400.         (copylib
  401.             (prompt    (#copy "FileID.library" #library-dest))
  402.             (source    "libs/FileID.library")
  403.             (dest    #library-dest)
  404.         )
  405.     )
  406. )
  407.  
  408. (complete 50)
  409.  
  410. (if (BITAND #install-files #item-num-guide)
  411.     (
  412.         (set #guide-source
  413.                         (tackon (tackon "Docs/" @language) "MultiView.guide")
  414.                 )
  415.             (copyfiles
  416.             (prompt (#copy "MultiView.guide" #guide-dest))
  417.             (source #guide-source)
  418.             (dest   #guide-dest)
  419.         )
  420.  
  421.         (if #guide-icon
  422.             (
  423.                 (copyfiles
  424.                     (prompt (#copy "MultiView.guide.info" #guide-dest))
  425.                     (source (tackon (tackon "Docs/" @language) "MultiView.guide.info"))
  426.                     (dest   #guide-dest)
  427.                 )
  428.             )
  429.         )
  430.     )
  431. )
  432.  
  433. (complete 70)
  434.  
  435. ; .ct
  436. (if (BITAND #install-files #item-num-locale)
  437.     (
  438.         (set #n 0)
  439.  
  440.         (while
  441.             (set #language
  442.                 (select #n
  443.                     "Deutsch"
  444.                     "English"
  445.                     "Polski"
  446.                     ""
  447.                 )
  448.             )
  449.  
  450.             (
  451.                 (if (AND (IN #lang #n) (<> #language "English"))
  452.                     (
  453.                         (set #catalog
  454.                             (tackon "Catalogs"
  455.                                 (tackon #language "MultiView.catalog")
  456.                             )
  457.                         )
  458.  
  459.                         (set #destination (tackon "Locale:Catalogs/" #language))
  460.  
  461.                         (if (exists #catalog)
  462.                             (copylib
  463.                                 (prompt (#copy #catalog #destination))
  464.                                 (source #catalog)
  465.                                 (dest   #destination)
  466.                             )
  467.                         )
  468.  
  469.                         (set #catalog
  470.                             (tackon "Catalogs"
  471.                                 (tackon #language "FileID_lib.catalog")
  472.                             )
  473.                         )
  474.  
  475.                         (if (exists #catalog)
  476.                             (copylib
  477.                                 (prompt (#copy #catalog #destination))
  478.                                 (source #catalog)
  479.                                 (dest   #destination)
  480.                             )
  481.                         )
  482.  
  483.                     )
  484.                 )
  485.  
  486.                 (set #n (+ #n 1))
  487.             )
  488.         )
  489.     )
  490. )
  491.  
  492. (complete 100)
  493.  
  494. (exit)
  495.